import { post } from "~~/request/request";
interface requestType {
    code: number,
    message: string,
    data?: any
}
export default defineEventHandler(async (event) => {
    const rebody = await readBody(event);
    try {
        const res = await $fetch<requestType>(`http://localhost:3005/api/login`, {
            method: "post",
            body: {
                username: rebody.username,
                password: rebody.password,
            }
        })
        return res;
    }
    catch (error) {
        return error
    }
})